import { MessageParams, TostMessageType } from "@/types";

const customUtils = {
  /**
   * 展示message提示信息，默认展示成功通知
   * @param hint string, MessageParams 提示内容
   */
  showMessage(hint: string | MessageParams, type: TostMessageType = "success") {
    console.log(hint, type);
  },
  //   showMessage(hint: string | MessageParams, type: TostMessageType = "success") {
  //     if (!hint) return;
  //     if (typeof hint !== "string") return ElMessage(hint);
  //     const speed = 7; //速度：7字/秒
  //     let duration = (hint.length / speed) * 1000;
  //     if (duration < 1500) duration = 1500;
  //     ElMessage({
  //       message: hint,
  //       type,
  //       duration,
  //       grouping: true,
  //       showClose: duration > 2000,
  //     });
  //   },
};

export default customUtils;
